package kikoqiu.flex;
import flex.messaging.messages.*;

public class ConsumerCallBack {
	/**
	 * Called when a message reaches, default is a call to onAsyncMessage
	 * @param msg
	 * @see onAsyncMessage
	 */
	public void onMessage(Object msg){
		if(msg instanceof AsyncMessage){
			onAsyncMessage((AsyncMessage)msg);
		}else{
			System.out.println(""+msg);
		}
	}
	/**
	 * Called when an AsyncMessage reaches
	 * @param msg
	 */
	public void onAsyncMessage(AsyncMessage msg){
		System.out.println(""+msg);
	}
	/**
	 * Called when an Ack message reaches
	 * @param msg
	 */
	public void onAcknowledgeMessageExt(AcknowledgeMessage msg){
		//System.out.println(""+msg);
	}
	/**
	 * Called when an exception happened
	 * @param e
	 */
	public void onFault(Exception e){
		e.printStackTrace();
	}
}
